from flask import Flask, request
from flask import Flask, render_template

from reserch import reserch4letters

app = Flask(__name__)


@app.route('/', methods=['GET'])
def hello_world():
    return render_template('hello.html')


# 名字全称
@app.route('/index',methods=['GET'])
def index():
    return render_template('index.html')
@app.route('/name',methods=['POST'])
def name():
    py_firstname = request.form['firstname']
    py_lastname = request.form['lastname']
    py_fullname = py_firstname.title()+' '+py_lastname.title()
    return render_template('name.html',fullname=py_fullname)
#元音字母
@app.route('/vowel',methods=['GET'])
def vowel():
    return render_template('vowel.html')
@app.route('/result',methods=['POST'])
def result():
    py_word = request.form['word']
    py_vowels = request.form['vowels']
    py_found = reserch4letters(py_vowels, py_word)
    return render_template('result.html',found = py_found)

#购物车
@app.route('/购物车登录页面',methods=['GET'])
def user_input():
    return render_template('购物车登录页面.html')
@app.route('/shop',methods=['POST'])
def entry_result():
    return render_template('shop.html')
if __name__ == '__main__':
    app.run(host='127.0.0.1',port=5000,debug=True)
